<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/9/16
 * Time: 16:29
 */
namespace App\Common;
class Utils{
    /*
     * 精确到毫秒，每毫秒还会随机9999。经过这么处理，百分之99.99不会重复
     * 生成唯一的订单号
     * @return string
     */
    public static  function orderSn() {
        $order_no = date('YmdHis'). substr(microtime(), 2, 5) . sprintf('%02d', rand(1000, 9999));
        return $order_no;
    }

}